/*
 * Copyright (c) 2019.11，华乘电气科技有限公司
 * All rights reserved.
 *
 * 文件名称：tevspectrumdefine.h
 * 
 * 初始版本：1.0
 * 作者：洪澄
 * 创建日期：2019/11/08
 * 摘要：TEV图谱数据定义
 * 当前版本：1.0
 */

#pragma once

#include <QString>
#include <vector>
#include "dataspecification_def.h"

namespace DataSpecificationGW
{
    struct TEVAmpExtInformation
    {
        AmpUnit eAmpUnit;               //幅值单位
        float fAmpLowerLimit;           //幅值下限
        float fAmpUpperLimit;           //幅值上限

        TEVAmpExtInformation()
        {
            eAmpUnit = AMP_UNIT_DEFAULT;
            fAmpLowerLimit = 0;
            fAmpUpperLimit = 0;
        }

        TEVAmpExtInformation& operator=(const TEVAmpExtInformation& stTEVAmpExtInformation)
        {
            this->eAmpUnit = stTEVAmpExtInformation.eAmpUnit;
            this->fAmpLowerLimit = stTEVAmpExtInformation.fAmpLowerLimit;
            this->fAmpUpperLimit = stTEVAmpExtInformation.fAmpUpperLimit;
            return *this;
        }

        bool operator==(const TEVAmpExtInformation& stTEVAmpExtInformation) const
        {
            if (!(this->eAmpUnit == stTEVAmpExtInformation.eAmpUnit)) return false;
            if (!qFuzzyCompare(this->fAmpLowerLimit, stTEVAmpExtInformation.fAmpLowerLimit)) return false;
            if (!qFuzzyCompare(this->fAmpUpperLimit, stTEVAmpExtInformation.fAmpUpperLimit)) return false;
            return true;
        }
    };

    struct TEVAmpData
    {
        float fTEVAmpValue;             //暂态地电压幅值数据
        float fTEVMaxValue;             //暂态地电压幅值最大值
        qint32 iPulseCount;             //脉冲数
        float fSeverity;                //严重程度
        QString qstrBGFileName;         //背景文件名称
        DischargeSeverity eDischargeSeverity;         //报警等级

        TEVAmpData()
        {
            fTEVAmpValue = 0;
            fTEVMaxValue = 0;
            iPulseCount = 0;
            fSeverity = 0;
            eDischargeSeverity = DISCHARGE_SEVERITY_LEVEL_0;
        }

        TEVAmpData& operator=(const TEVAmpData& stTEVAmpData)
        {
            this->fTEVAmpValue = stTEVAmpData.fTEVAmpValue;
            this->fTEVMaxValue = stTEVAmpData.fTEVMaxValue;
            this->iPulseCount = stTEVAmpData.iPulseCount;
            this->fSeverity = stTEVAmpData.fSeverity;
            this->qstrBGFileName = stTEVAmpData.qstrBGFileName;
            this->eDischargeSeverity = stTEVAmpData.eDischargeSeverity;
            return *this;
        }

        bool operator==(const TEVAmpData& stTEVAmpData) const
        {
            if (!qFuzzyCompare(this->fTEVAmpValue, stTEVAmpData.fTEVAmpValue)) return false;
            if (!qFuzzyCompare(this->fTEVMaxValue, stTEVAmpData.fTEVMaxValue)) return false;
            if (!(this->iPulseCount == stTEVAmpData.iPulseCount)) return false;
            if (!qFuzzyCompare(this->fSeverity, stTEVAmpData.fSeverity)) return false;
            if (!(this->qstrBGFileName == stTEVAmpData.qstrBGFileName)) return false;
            if (!(this->eDischargeSeverity == stTEVAmpData.eDischargeSeverity)) return false;
            return true;
        }
    };
}
